package com.课上案例练习.IO流.合并流;

import java.io.*;
import java.util.Enumeration;
import java.util.Vector;

public class Test1 {
    public static void main(String[] args) throws IOException {
        //创建多个字节输入流
        FileInputStream fileInputStream1 = new FileInputStream("t1.txt");
        FileInputStream fileInputStream2 = new FileInputStream("t2.txt");
        FileInputStream fileInputStream3 = new FileInputStream("java.txt");
        FileInputStream fileInputStream4 = new FileInputStream("text1.txt");
        //利用vector集合,接收多个字节输入流，使用内置方法element() 让合并流的构造器接收
        Vector<InputStream> vector = new Vector<>();
        vector.add(fileInputStream1);
        vector.add(fileInputStream2);
        vector.add(fileInputStream3);
        vector.add(fileInputStream4);
        //vector使用内置方法element() 让合并流的构造器接收
        Enumeration<InputStream> elements = vector.elements();
        // public SequenceInputStream(Enumeration<? extends InputStream> e) 构造器接收的泛型
        SequenceInputStream sequenceInputStream = new SequenceInputStream(elements);


    }
}
